/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jhu.bookstore;

/**
 *
 * @author jowens
 */
public class Book {

    private int bookId;
    private String bookName;
    private String author;
    private String category;
    private double price;
    private String synopsis;

    public Book(int bookId, String bookName, String author, String category, double price, String synopsis) {
        this.bookId = bookId;
        this.bookName = bookName;
        this.author = author;
        this.category = category;
        this.price = price;
        this.synopsis = synopsis;
    }

    public int getBookId() {
        return bookId;
    }

    public String getBookName() {
        return bookName;
    }
    
    public String getAuthor() {
        return author;
    }

    public String getCategory() {
        return category;
    }

    public double getPrice() {
        return price;
    }

    public String getSynopsis() {
        return synopsis;
    }
    
    @Override
    public String toString() {
        String theString = new String();
        theString = bookId + " : " + bookName + " : " + author + " : " + category + " : " + price + " : " + synopsis;
        return theString;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Book other = (Book) obj;
        if (this.bookId != other.bookId) {
            return false;
        }
        if ((this.bookName == null) ? (other.bookName != null) : !this.bookName.equals(other.bookName)) {
            return false;
        }
        if ((this.author == null) ? (other.author != null) : !this.author.equals(other.author)) {
            return false;
        }
        if ((this.category == null) ? (other.category != null) : !this.category.equals(other.category)) {
            return false;
        }
        if (Double.doubleToLongBits(this.price) != Double.doubleToLongBits(other.price)) {
            return false;
        }
        if ((this.synopsis == null) ? (other.synopsis != null) : !this.synopsis.equals(other.synopsis)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 41 * hash + this.bookId;
        hash = 41 * hash + (this.bookName != null ? this.bookName.hashCode() : 0);
        hash = 41 * hash + (this.author != null ? this.author.hashCode() : 0);
        hash = 41 * hash + (this.category != null ? this.category.hashCode() : 0);
        hash = 41 * hash + (int) (Double.doubleToLongBits(this.price) ^ (Double.doubleToLongBits(this.price) >>> 32));
        hash = 41 * hash + (this.synopsis != null ? this.synopsis.hashCode() : 0);
        return hash;
    }
    
    
}
